<div class="category" style="border: none;border-radius: 0px 0px 3px 3px;">
    <div class="title-category">
        <span><i class="icon-supportonline"></i>SẢN PHẨM</span>
    </div>
    <div class="category-content">
        <?php
            $baseUrl = $this->baseUrl('');
            $category = new Default_Model_Category();
            $furnitureCategory = $category->listCategory('furniture_category');
            
            function displayMenu($parents, $menuData, $url, $string) {
                $items = '';
                if(isset($menuData['parents'][$parents])) {
                    $items .= '<ul>';
                    foreach($menuData['parents'][$parents] as $value) {
                        $items .= '<li>';
                        $items .= '<a href="'.$url.'danh-muc-'.$string.'/'.$menuData['items'][$value]['url'].'-'.$menuData['items'][$value]['id'].'.html">'.$menuData['items'][$value]['name'].'<i class="icon-li"></i></a>';
                        $items .= displayMenu($value, $menuData, $url, $string);
                        $items .= '</li>';
                    }
                    $items .= '</ul>';
                }
                return $items;
            }

            if(count($furnitureCategory) > 0) {
                foreach($furnitureCategory as $value) {
                    $menuFurniture['items'][$value['id']] = $value;
                    $menuFurniture['parents'][$value['parents']][] = $value['id'];
                }
                echo displayMenu(1, $menuFurniture, $baseUrl, 'do-gia-dung');
            }
        ?>
    </div>
</div>